<template>
<div class="page">
  <navTop title="会商详情" />
	<img class="header_img" :src="data.img" alt="">
	<div class="title_h">
		{{data.name||''}}
		<!-- <div class="small flex_ac" v-if="data.title">
			<div class="mr20">{{data.from||''}}</div>  
			<div class="">{{data.create_time.split(' ')[0]||''+' '}}</div>
			<div class="mla flex_ac">
				<img width="12px" height="12px" class="mr4" src="~@/assets/img/project/see.png" alt="">
				<div>{{data.read_num}}</div>
			</div>
		</div> -->
	</div>

	<div class="flex mb10 ml10">
		<div class="label bg1">{{data.type_name}}</div>
		<!-- <div class="label bg2">高新技术企业</div>
		<div class="label bg3">数字金融</div> -->
	</div>

	<div class="info_div">
		<div class="info_item flex_ac">
			<div class="info_name">时间</div>： <span>{{  data.starttime? data.starttime.split(' ')[0] + ' ～ ' + data.endtime.split(' ')[0] : '-' }}</span>
		</div>
		<div class="info_item flex_ac mt10">
			<div class="info_name">地点</div>： <span>{{ data.address||'-' }}</span>
		</div>
		<div class="info_item flex_ac mt10">
			<div class="info_name">联系人</div>： <span>{{ data.contact||'-' }}</span>
		</div>
		<div class="info_item flex_ac mt10">
			<div class="info_name">联系电话</div>： <span>{{ data.mobile||'-' }}</span>
		</div>
	</div>
	<div class="mt25 line_h"></div>
	<div class="ml10 mt15 main_title">会议议程</div>
	<div class="page1">
		<div class="content" v-html="data.content"></div>
	</div>
	<!-- <div class="page1">
		
		<div class="news_ps" v-if="data.company_names?.length>0">
			<div class="news_title">查看相关企业投资意愿画像</div>
			<div class="news_company" v-for="i,k in data.company_names" :key="k" @click="toCompany(i.identification)">
				{{i.company_name}}
			</div>
		</div>
		
		<div class="content" v-html="data.content"></div>
		
		<div class="news_ps">
			@注：版权归原作者所有如有侵权请立即与我们联系,我们将及时处理
		</div>
	</div> -->

	<div class="h50"></div>
	<bottomDetail :data='data' type="5"></bottomDetail>
</div>
</template>

<script>
	import { meeting } from '@/api/api.js'
	import navTop from '@/components/navTop.vue'
	import bottomDetail from '@/components/bottomDetail.vue'
	export default {
		data() {
			return {
				data:{id:'',image:'',chain_names:''},
				id:'',
			}
		},
		components:{
      bottomDetail,
      navTop
		},
		created(){
			this.id = this.$route.query.id
			this.getDetail(this.id)
		},
		methods: {
			toCompany(identification){
				if(!identification){
					this.$toast({
						title:'系统暂无该企业的完整信息，请稍后重试'
					})
					return
				}
				this.$router.push({name:'companyDetail',query:{identification}})
			},
			getDetail(id){
				this.$toast.loading({
          message: '加载中...',
          forbidClick: true,
        });
				meeting.getDetail({id}).then(res=>{
					let newContent = res.data.content.replace(/<img[^>]*>/gi, function(match, capture) {
            match = match.replace(/style="[^"]+"/gi, '').replace(/style='[^']+'/gi, '');
            match = match.replace(/width="[^"]+"/gi, '').replace(/width='[^']+'/gi, '');
            match = match.replace(/height="[^"]+"/gi, '').replace(/height='[^']+'/gi, '');
            return match;
          });
					newContent = newContent.replace(/\<img/gi,
							'<img style="max-width:100%;height:auto;display:block;margin:0px auto;"');
					res.data.content = newContent
					this.data = res.data
					this.$toast.clear()
				})
			},
		}
	}
</script>

<style  lang="scss" scoped>
.nav{
	width: 100%;
  height: 40px;
}
.page{
  position: relative;
}
.page1{
  margin: 10px;
}
.header_img{
	width: calc(100% - 20px);
	margin-left: 10px;
	border-radius: 4px;
}
.title_h{
	font-weight: 600;
  font-size: 22px;
  color: #000000;
	margin: 0 14px;
	padding: 10px 0;
	.small{
		display: flex;
		justify-content: space-between;
		font-size: 12px;
		color: #666;
		margin: 20px 0 0px;
    font-weight: 500;
	}
}

.news_ps{
	color:#999;
	font-size:14px;
	margin: 20px 0;
}


.news_title{
	font-size:16px;
	color: #333;
	font-weight:700;
	margin-bottom:10px;
}
.news_company{
	font-size:14px;
	color:#EB7418;
	margin-bottom: 8px;
	text-decoration: underline;
}
.content{

}

.info_div{
	margin: 10px;
	border-radius: 3px;
	background: #FA8A2611;
	padding: 15px 10px;
	margin-top: 5px;
}
.info_item{
	font-size: 13px;
	color: #000;
	.info_name{
		text-align-last: justify;
		width: 56px;
	}
	span{
		color: #666;
	}
}
.label{
	height: 17px;
	line-height: 17px;
	border-radius: 3px;
	font-size: 11px;
	padding:  0 8px;
	margin-right: 10px;
}
.bg1{
	background: rgba(48,149,59,0.1);
	color: #2F953A;
}
.bg2{
	background: rgba(235,116,24,0.1);
	color: #EB7418;
}
.bg3{
	background: rgba(19,138,242,0.1);
	color: #138AF2;
}
.line_h{
	width: 100%;
	height: 5px;
background: #F0F0F0;
}
.main_title{
	font-weight: bold;
	font-size: 15px;
	color: #EB7418;
}
</style>
